﻿Public Class m_usuario
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        seguridad.verificapermisos()
    End Sub

    Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click

    End Sub

    Protected Sub ASPxButton1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ASPxButton1.Click
        Dim table As DataSet1TableAdapters.usuariosTableAdapter


        MsgBox(comboempresa.Value)
        MsgBox(comboniveluser.Value)
        MsgBox(comboniveluser1.Value)


        Try
            table.InsertQuery(txtnombre.Text, txttelefono0.Text, txtemail.Text, txtlogin.Text, txtpass.Text, comboempresa.Value, comboniveluser1.Value, comboniveluser.Value)
        Catch ex As Exception
            MsgBox("No se pudo insertar a la base de datos")
        End Try
        txtnombre.Text = ""
        txttelefono0.Text = ""
        txtemail.Text = ""
        txtlogin.Text = ""
        txtpass.Text = ""
        comboempresa.Text = ""
        comboniveluser1.Text = ""
        comboniveluser.Text = ""

    End Sub

    Protected Sub ImageButton3_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton3.Click
        Dim sUrl As String = "frmRptUsuarios.aspx"
        Dim sScript As String = "<script language =javascript> "
        sScript += "window.open('" & sUrl & "',null,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=300,left=100,top=100');"
        sScript += "</script> "
        Response.Write(sScript)
        Dim repot As New rptUsuarios
        repot.VUsuariosTodosTableAdapter.Fill(repot.DataSet11.vUsuariosTodos)

    End Sub
End Class